package com.qianniu.napi.admin.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.google.common.base.Strings;
import com.qianniu.napi.common.util.DateUtil;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 联盟商家折扣表（共享会员折扣表）
 * </p>
 *
 * @author chenxuebin
 * @since 2020-04-05
 */
@TableName("t_league_member")
public class LeagueMember extends Model<LeagueMember> {

	private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Long id;
	/**
	 * 联盟id
	 */
	private Long leagueid;
	/**
	 * 商家id
	 */
	private Long sid;
	/**
	 * 折扣
	 */
	private BigDecimal zhekou;
	/**
	 * 折扣简称
	 */
	private String zkname;
	private String nickname;
	private String headimg;
	private String sname;
	private String phone;

	/**
	 * 是否有效
	 */
	private Integer state;
	@TableField(exist = false)
	private Integer fens;
	private Integer utype;
	private Integer yixiang;
	/**
	 * 是否员工
	 */
	private Integer isstaff;

	/**
	 * 会员级别
	 */
	private Integer mlevel;

	/**
	 * 邀请会员数
	 */
	private Integer yaoqing;

	/**
	 * 最后一次消费
	 */
	private String lastxf;
	private String createday;

	@TableField(exist = false)
	private String lastxfstr;

	/**
	 * 开始时间
	 */
	private Date startdate;
	/**
	 * 结束时间
	 */
	private Date enddate;
	private Long mid;
	private Long mpid;
	private Long uid;
	private Long shareid;
	private Long pshareid;
	private String sharename;

	private Long lmshareid;
	private String lmsharename;

	private Date createtime;
	private Long creator;
	private Date modifytime;
	private Long modifior;

	@TableField(exist = false)
	private String startday;
	@TableField(exist = false)
	private String endday;
	@TableField(exist = false)
	private String endshortday;
	@TableField(exist = false)
	private String startshortday;

	@TableField(exist = false)
	private String mquanyi;

	@TableField(exist = false)
	private String xiamquanyi;

	@TableField(exist = false)
	private Store store;

	@TableField(exist = false)
	private List<CouponTplShare> yqlist;
//	private List<LeagueMember> yqlist;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getLeagueid() {
		return leagueid;
	}

	public void setLeagueid(Long leagueid) {
		this.leagueid = leagueid;
	}

	public Long getSid() {
		return sid;
	}

	public void setSid(Long sid) {
		this.sid = sid;
	}

	public BigDecimal getZhekou() {
		return zhekou;
	}

	public void setZhekou(BigDecimal zhekou) {
		this.zhekou = zhekou;
	}

	public String getZkname() {
		return zkname;
	}

	public void setZkname(String zkname) {
		this.zkname = zkname;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Date getStartdate() {
		return startdate;
	}

	public void setStartdate(Date startdate) {
		this.startdate = startdate;
	}

	public Date getEnddate() {
		return enddate;
	}

	public void setEnddate(Date enddate) {
		this.enddate = enddate;
	}

	public Long getMid() {
		return mid;
	}

	public void setMid(Long mid) {
		this.mid = mid;
	}

	public Long getMpid() {
		return mpid;
	}

	public void setMpid(Long mpid) {
		this.mpid = mpid;
	}

	public Long getUid() {
		return uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	public Long getCreator() {
		return creator;
	}

	public void setCreator(Long creator) {
		this.creator = creator;
	}

	public Date getModifytime() {
		return modifytime;
	}

	public void setModifytime(Date modifytime) {
		this.modifytime = modifytime;
	}

	public Long getModifior() {
		return modifior;
	}

	public void setModifior(Long modifior) {
		this.modifior = modifior;
	}

	public Long getShareid() {
		return shareid;
	}

	public void setShareid(Long shareid) {
		this.shareid = shareid;
	}

	public String getSharename() {
		return sharename;
	}

	public void setSharename(String sharename) {
		this.sharename = sharename;
	}

	public Integer getMlevel() {
		return mlevel;
	}

	public void setMlevel(Integer mlevel) {
		this.mlevel = mlevel;
	}

	public String getMquanyi() {
		return mquanyi;
	}

	public void setMquanyi(String mquanyi) {
		this.mquanyi = mquanyi;
	}

	public String getXiamquanyi() {
		return xiamquanyi;
	}

	public void setXiamquanyi(String xiamquanyi) {
		this.xiamquanyi = xiamquanyi;
	}

	public String getStartday() {
		if(this.startdate==null)return null;
		startday = DateUtil.getToday(this.startdate);
		return startday;
	}

	public void setStartday(String startday) {
		this.startday = startday;
	}

	public String getEndday() {
		if(this.enddate==null)return null;
		endday = DateUtil.getToday(this.enddate);
		return endday;
	}

	public void setEndday(String endday) {
		this.endday = endday;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEndshortday() {
		if(this.enddate==null)return null;
		endshortday = DateUtil.getToday(this.enddate);
		return endshortday.replaceAll("-","");
	}

	public void setEndshortday(String endshortday) {
		this.endshortday = endshortday;
	}

	public String getStartshortday() {
		if(this.startdate==null)return null;
		startshortday = DateUtil.getToday(this.startdate);
		return startshortday.replaceAll("-","");
	}

	public void setStartshortday(String startshortday) {
		this.startshortday = startshortday;
	}

	public String getSname() {
		return sname;
	}

	public void setSname(String sname) {
		this.sname = sname;
	}

	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	public String getHeadimg() {
		return headimg;
	}

	public void setHeadimg(String headimg) {
		this.headimg = headimg;
	}

	public Integer getUtype() {
		return utype;
	}

	public void setUtype(Integer utype) {
		this.utype = utype;
	}

	public Long getLmshareid() {
		return lmshareid;
	}

	public void setLmshareid(Long lmshareid) {
		this.lmshareid = lmshareid;
	}

	public String getLmsharename() {
		return lmsharename;
	}

	public void setLmsharename(String lmsharename) {
		this.lmsharename = lmsharename;
	}

	public Integer getYaoqing() {
		return yaoqing;
	}

	public void setYaoqing(Integer yaoqing) {
		this.yaoqing = yaoqing;
	}

	public String getLastxf() {
		return lastxf;
	}

	public void setLastxf(String lastxf) {
		this.lastxf = lastxf;
	}

	public List<CouponTplShare> getYqlist() {
		return yqlist;
	}

	public void setYqlist(List<CouponTplShare> yqlist) {
		this.yqlist = yqlist;
	}

	public String getLastxfstr() {
		if(Strings.isNullOrEmpty(lastxf))return null;
		lastxfstr = lastxf.substring(5);
		return lastxfstr;
	}

	public void setLastxfstr(String lastxfstr) {
		this.lastxfstr = lastxfstr;
	}

	public Integer getIsstaff() {
		return isstaff;
	}

	public void setIsstaff(Integer isstaff) {
		this.isstaff = isstaff;
	}

	public String getCreateday() {
		return createday;
	}

	public void setCreateday(String createday) {
		this.createday = createday;
	}

	public Integer getFens() {
		return fens;
	}

	public void setFens(Integer fens) {
		this.fens = fens;
	}

	public Long getPshareid() {
		return pshareid;
	}

	public void setPshareid(Long pshareid) {
		this.pshareid = pshareid;
	}

	public Integer getYixiang() {
		return yixiang;
	}

	public void setYixiang(Integer yixiang) {
		this.yixiang = yixiang;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "LeagueMember{" +
				"id=" + id +
				", leagueid=" + leagueid +
				", sid=" + sid +
				", zhekou=" + zhekou +
				", zkname=" + zkname +
				", state=" + state +
				", startdate=" + startdate +
				", enddate=" + enddate +
				", mid=" + mid +
				", mpid=" + mpid +
				", uid=" + uid +
				", createtime=" + createtime +
				", creator=" + creator +
				", modifytime=" + modifytime +
				", modifior=" + modifior +
				"}";
	}
}